<html>
<head>
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>ideaology 世糟广</title>
    <style>
    *{ margin: 0; padding: 0}
	body, button, input, select, textarea { font: 12px/1.5 "黑体";}
	h1, h2, h3, h4, h5, h6 { font-size: 100%}
	em{ font-style: normal}
	ul, ol { list-style: none}
	a { text-decoration: none}
	img { border: 0; max-width:100% }
	.clearfix:after {content:"."; display:block; height:0; clear:both; visibility:hidden}
	body,html,.wrap{height: 100%;}
	.wrap{width: 100%; overflow-x:hidden}
	.fl{float: left }
	.fr{float: right }
    .page-con {
		width: 100%;
	    height: 100%;
	    background-color: black;
	    position: absolute;
	    top: 0;
	    left: 0;
	    background-size: cover;
	}
	.video-box {
		width: 100%;
	    height: 100%;
	    background-color: black;
	}
	.page1-con {
		display: none;
		width: 100%;
		height: 56.2%;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate( -50%, -50%);
	    background: url(/images/kiss.jpg) center center no-repeat;
	    background-size: contain;
	}
	.page2 {
		display: none;
	}
	.done .page1-con {
		display: block;
	}
    .toast {
        display: none;
        position: fixed;
        left: 50%;
        top: 50%;
        transition: all .3s linear;
        transform: translate(-50%, -50%);
        border-radius: 3px;
        width: 150px;
        padding: 10px;
        font-size: 14px;
        text-align: center;
        color: #fff;
        background: rgba(40,40,40,.75);
    }
    .toast.show {
        display: block;
    }
    </style>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>

<body>
    <div class="wrap">
    	<div class="page page1">
    		<video class="video-box" id="videoIndex1" x-webkit-airplay="true" webkit-playsinline="true" preload="auto" autoplay src="http://77g2du.com1.z0.glb.clouddn.com/3.mp4" ></video>
    		<div class="page1-con page-con" id="kiss"></div>
    	</div>
    	<div class="page page2">
    		<video class="video-box" id="videoIndex2" x-webkit-airplay="true" webkit-playsinline="true" preload="auto" autoplay  src="http://77g2du.com1.z0.glb.clouddn.com/2.mp4" ></video>
    	</div>
	</div>
    <div id="toast" class="toast"><p>别点！你倒是亲啊！</p></div>
</body>
<script>
    wx.error(function(res){
    	alert(JSON.stringify(res))
    });
    wx.ready(function(){
        wx.onMenuShareTimeline({
            title: '[HD/5M]OBA-269ノー紅裙ンで僕を誘す吻ん汚な2発射.avi', // 分享标题
            link: location.href, // 分享链接
            imgUrl: 'http://wx.ideaology.cn/images/title.png', // 分享图标
            success: function () {
                // alert(1);
            },
            cancel: function () {
                // alert(2);
            }
        });

    	wx.onMenuShareAppMessage({
		    title: '[HD/5M]紅裙ン誘す吻ん汚な.avi', // 分享标题
		    desc: '', // 分享描述
		    link: location.href, // 分享链接
		    imgUrl: 'http://wx.ideaology.cn/images/title.png', // 分享图标
		    type: '', // 分享类型,music、video或link，不填默认为link
		    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
		    success: function () {
                // alert(1);
		    },
		    cancel: function () {
		    	// alert(2);
		    }
		});

    });
	wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: '{{appid}}', // 必填，公众号的唯一标识
        timestamp: {{auth.timestamp}}, // 必填，生成签名的时间戳
        nonceStr: '{{auth.noncestr}}', // 必填，生成签名的随机串
        signature: '{{signature}}', // 必填，签名，见附录1
        jsApiList: [
	        'checkJsApi',
	        'onMenuShareTimeline',
	        'onMenuShareAppMessage',
	        'onMenuShareQQ',
	        'onMenuShareWeibo',
	        'onMenuShareQZone',
	        'hideMenuItems',
	        'showMenuItems',
	        'hideAllNonBaseMenuItem',
	        'showAllNonBaseMenuItem',
	        'translateVoice',
	        'startRecord',
	        'stopRecord',
	        'onVoiceRecordEnd',
	        'playVoice',
	        'onVoicePlayEnd',
	        'pauseVoice',
	        'stopVoice',
	        'uploadVoice',
	        'downloadVoice',
	        'chooseImage',
	        'previewImage',
	        'uploadImage',
	        'downloadImage',
	        'getNetworkType',
	        'openLocation',
	        'getLocation',
	        'hideOptionMenu',
	        'showOptionMenu',
	        'closeWindow',
	        'scanQRCode',
	        'chooseWXPay',
	        'openProductSpecificView',
	        'addCard',
	        'chooseCard',
	        'openCard'
	      ]
    });
</script>
<script src="/vendor/zepto.min.js"></script>
<script>
    var ratio = 968 / 544;
    var screen_width ,screen_heigh;
    var query = function(selector){
        return document.querySelector(selector);
    };
    var v1 = query("#videoIndex1"),v2 = query("#videoIndex2"), kiss = $("#kiss"), toast = $("#toast");
    setKissStyle();
    window.addEventListener("orientationchange", function() {
        setKissStyle()
    });
    window.addEventListener("resize", function() {
        setKissStyle()
    });
    function setKissStyle() {
        screen_width = document.documentElement.clientWidth,
        screen_height = document.documentElement.clientHeight;
        if (screen_width / screen_height > 1.7) {
            kiss.css({
                "height": "100%",
                "width": ratio * screen_height + "px"
            });
        } else {
            kiss.css({
                "width": "100%",
                "height": "56.2%"
            });
        }
    }
    setTimeout(function(){
        v2.pause();
    },100);
    var timer;
    v1.addEventListener("ended",function(e) {
        $(".page1").addClass("done");
        timer = setTimeout(function () {
            stage2();
        }, 5000);
    });
    kiss.on('touchstart', function (e) {
        if (e.touches.length > 1) {
            clearTimeout(timer);
            stage2();
        } else {
            toast.addClass("show");
            setTimeout(function () {
                toast.removeClass("show");
            }, 3000);
        }
    });

    function stage2() {
        $(".page1").remove();
        $(".page2").show();
        setTimeout(function (){
          v2.play();
        },200)
    }
</script>
</html>
